﻿<?php 
include("../inc/global.inc");

if($_POST[act]){
   if($_SESSION['chkCode']==$_POST['c_code']){
        $sql="select * from job_per where  p_user='$_POST[member_id]'";
        $rs=@mysql_query($sql);
        $row=@mysql_fetch_array($rs);
           if($row['id']){
		        if($row[p_email]==$_POST[email]){
                
				//start sent email
		        
				
					 $content=iconv("utf-8","gb2312","<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN' 'http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd'>
<HTML xmlns='http://www.w3.org/1999/xhtml'>
<HEAD>
<TITLE>邮件来自三帝招聘网</TITLE>
<style type='text/css'>
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	font-size: 12px;
	FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif;
	background-color: #FFFFFF;
}
a:link {
	color: #003399;
	text-decoration: underline;
}
a:hover {
	color: #FF6600;
	text-decoration: underline;
}
a:active {
	color: #003399;
	text-decoration: underline;
}
a:visited {
	color: #003399;
	text-decoration: underline;
}



#mail {
	padding: 0px;
	width: 622px;
	margin-top: 0px;
	margin-right: auto;
	margin-bottom: 0px;
	margin-left: auto;
	border-right-width: 1px;
	border-left-width: 1px;
	border-right-style: solid;
	border-left-style: solid;
	border-right-color: #ECE9D8;
	border-left-color: #ECE9D8;
}
#mail .info .to {
	line-height: 22px;
}

#mail .info .title {
	font-family: Arial;
	font-size: 19px;
	padding: 5px;
	background-color: #EBEBEB;
}

#mail .logo {
	float: left;
	padding-top: 13px;
}
#mail .headbg {
	float: right;
}
#mail .info {
	padding: 10px;
}
#mail .info .note {
	background-color: #ECF3FB;
	padding: 5px;
	line-height: 18px;
}

#mail .foot {
	background-color: #7EB1DA;
	padding: 6px;
	text-align: right;
}

.onl {
	clear: both;
}
-->
</style>
</HEAD>
<BODY>
<div id='mail'>
<div class='logo'><img src='http://www.sandib2b.cn/images/logo.gif' width='388' height='58'></div>
<div class='headbg'><img src='http://www.sandib2b.cn/images/headbg.gif' width='220' height='75'></div>
<div class='onl'></div>
<table width='100%' border='0' cellpadding='0' cellspacing='0'>
  <tr>
    <td height='42' align='right' valign='bottom' background='http://www.sandib2b.cn/images/webbg.gif'><img src='http://www.sandib2b.cn/images/messbg.gif' width='257' height='28'></td>
    </tr>
</table>
<div class='info'>
  <table cellspacing='0' cellpadding='0' width='100%' align='center' border='0'>
    <tbody>
      <tr>
        <td width='593' height='300' valign='top'><div><strong>您好,"."$row[p_name]"."</strong>
                <div class='to'>会员账号:"."$row[p_user]"."<br>
                  安全码:$row[p_psw]<br>
                  设置新密码:<a href='http://job.sandib2b.cn/login/chongshe.php'>http://job.sandib2b.cn/login/chongshe.php</a>
				  <br>
				  <br>
                  <br>
				  <br>
				  <br>
                  <A href='http://job.sandib2b.cn/' target='_blank'>http://job.sandib2b.cn</A>
				  <BR>
                  <br>
				  警告：系统邮件请勿回复！
                </div>
          </div></td>
      </tr>
    </tbody>
  </table>
</div>
<div class='foot'>国内专业招聘平台<font color='#CC0000'>三帝招聘网</font></div>
</div>
</BODY>
</HTML>");
					 
					 
					 
					 sendmail($row['p_email'],"找回密码三帝招聘网",$content);
                     //sent email end
                     
					 
					 echo "<script>alert('重置密码邮件发送成功');location='/index.php';</script>";
					 }else{
					 
					 echo "<script>alert('您的邮箱错误');location='javascript:history.go(-1)';</script>";
					
					 }
					 
					 
                     
		   }else{
               echo "<script>alert('会员账号错误');location='javascript:history.go(-1)';</script>";
		   }
   }else{
      echo "<script>alert('验证码错误!');location='javascript:history.go(-1)';</script>";
   }
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>找回密码-三帝招聘网</title>
<link href="../css/body.css" rel="stylesheet" type="text/css"/>
<link href="../css/link.css" rel="stylesheet" type="text/css"/>
<link href="css/head.css" rel="stylesheet" type="text/css"/>
<link href="../css/foot.css" rel="stylesheet" type="text/css"/>
<link href="css/login.css" rel="stylesheet" type="text/css" />
</head>
<body>
<?php include("../inc/top.php");?>
<div class="main topside6 downside6">

<div class="login_box">
<div class="title">
  <table border="0" cellpadding="0" cellspacing="0" class="table">
    <tr>
      <td width="43" rowspan="2"><img src="images/icon2.gif" width="35" height="36" /></td>
      <td width="186" height="27"><img src="images/icon2txt.gif" width="97" height="20" /></td>
    </tr>
    <tr>
      <td height="20"> &nbsp;<span class="fontblue">&nbsp;</span><span class="fontgray">使用注册邮找回密码</span> </td>
    </tr>
  </table>
</div>
<div class="login">
<form name="form" action="" method="post" onSubmit="return checkform()">
    <table width="100%" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td height="26" colspan="2">&nbsp;</td>
      </tr>
      <tr>
        <td width="38%" height="44" align="right"><span class="size14 b">会员账号：</span></td>
        <td width="62%"><label>
          <input name="member_id" id="member_id" type="text" class="login_user" />
        </label></td>
      </tr>
      <tr>
        <td width="38%" height="44" align="right"><span class="size14 b">邮箱地址：</span></td>
        <td width="62%"><label>
          <input name="email" id="email" type="text" class="login_user" />
        </label></td>
      </tr>
      <tr>
        <td height="43" align="right"><span class="size14 b">验证码：</span></td>
        <td height="43"><input name="c_code" id="c_code" type="text" class="login_code" />&nbsp;&nbsp;<img src="/inc/chk_num.php" name="img" width="90" height="30" align="absmiddle" id="img">&nbsp;<a href="#" name="can not see" id="test">刷新验证码</a></td>
      </tr>
      <tr>
        <td height="68" colspan="2" align="center"><label><input name="Submit" type="submit" class="but" value=" 找回密码 " /></label></td>
        </tr><input type="hidden" name="act" value="ok" />
      <tr>
        <td height="54" colspan="2" align="center"><p>如果您注册时填写的邮箱无法使用了，请<a href="http://www.sandib2b.cn/about/contact.php" target="_blank">联系我们</a></p></td>
      </tr>
    </table>
  </form>
  </div>
</div>
</div>
<?php include("../inc/foot.php"); ?>

</body>
</html>
<script language="javascript">
function $(id){
return document.getElementById(id);
}
function checkform(){
 if($("member_id").value==""){
    alert("会员账号不能为空");
    $("member_id").focus();
    return false;
 }

var pattern = /^([a-zA-Z0-9_.-])+@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-])+/;
　　　　if(!pattern.test($("email").value)){
			alert("邮箱地址不正确.");
			$("email").focus();
			return false;
		}

}

function test(img){
    var src=img.getAttribute("src");
    src=src+"?new="+Math.random(0,10);
    img.setAttribute("src",src);
}
function prepare(){
    var nav=document.getElementById("test");
    var name=nav.getAttribute("name");
    var str="can not see";
    if(name==str){
        nav.onclick=function(){
            var img=document.getElementById("img");
            test(img);
            return false;
        }
    }
}
window.onload=prepare;
</script>

